<?php

class Student_Form_TestForm extends Zend_Dojo_Form
{
    /**
     * Options to use with select elements
     */
    protected $_selectOptions = array(
        'A'    => 'A',
        'A-'   => 'A-',
        'B+'  => 'B+',
        'B' => 'B',
        'B-'  => 'B-',
        'C+'  => 'C+',
        'C' => 'C',
        'C-' => 'C-',
        'D+' => 'D+',
        'D' => 'D',
        'D-' => 'D-',
        
    );

    protected $_selectAssignments = array('Homeworks' => 'Homeworks',
        'Prelims'   => 'Exams (including final)',
        'Quizzes'  => 'Quizzes',
        'Projects' => 'Projects',
        'Labs' => 'Labs',
        'Others' => 'Others',
        )
        ;

    /**
     * Form initialization
     *
     * @return void
     */
    public function init()
    {

        

        $this->setMethod('post');
        $this->setAttribs(array(
            'name'  => 'masterForm',
        ));
        $this->setDecorators(array(
            'FormElements',
            array('TabContainer', array(
                'id' => 'tabContainer',
                'style' => 'width: 500px; height: 500px;',
                'dijitParams' => array(
                    'tabPosition' => 'left'
                ),
            )),
            'DijitForm',
        ));
        $courseForm = new Zend_Dojo_Form_SubForm();
        $courseForm->setAttribs(array(
            'name'   => 'courseTab',
            'legend' => 'Text Elements',
            'dijitParams' => array(
                'title' => 'Course Information',
            ),
        ))
                ;
        $courseForm->addElement(
                 'ValidationTextBox',
                'course_name',
                array(
                    'value'      => '',
                    'label'      => 'Course Name :',
                    'trim'       => true,
                    'propercase' => true,
                    'width' => '10px'
                ))


                ->addElement(
                 'ValidationTextBox',
                'course_number',
                array(
                    'value'      => '',
                    'label'      => 'Course Number :',
                    'trim'       => true,
                    'propercase' => true,
                )) 

           ->addElement(
                'NumberSpinner',
                'course_credits',
                array(
                    'value'             => '1',
                    'label'             => 'Number of Credits',
                    'smallDelta'        => 1,
                    'min'               => 1,
                    'max'               => 10,
                    'places'            => 0,
                    'maxlength'         => 10,
                )
            )

          ->addElement(
                'RadioButton',
                'semester',
                array(
                    'label' => 'Semester :',
                    'multiOptions'  => array(
                        'Fall' => 'Fall',
                        'Spring' => 'Spring',
                        'Summer' => 'Summer',
                    ),
                    'value' => 'Summer',
                )
            )

           ->addElement(
                'ComboBox',
                'desired_grade',
                array(
                    'label' => 'Desired Grade :',
                    'value' => 'blue',
                    'autocomplete' => false,
                    'multiOptions' => $this->_selectOptions,
                ));


               // $submit = new Zend_Dojo_Form_Element_SubmitButton('Submit');
               // $this->addElement($submit);
		
		//$this->setMethod('POST');

           


            //hereeeeeeeee

        $gradeScaleForm = new Zend_Dojo_Form_SubForm();
        $gradeScaleForm->setAttribs(array(
            'name'   => 'gradeScaleTab',
            'legend' => 'Grading Scale',
        ));
        $gradeScaleForm->addElement(
                'ComboBox',
                'A1',

                array(
                    'label' => 'Grade :',
                    'value' => 'blue',
                    'autocomplete' => false,
                    'multiOptions' => $this->_selectOptions,
                    'style' =>'width: 4em'
                ))

        ->addElement(
                 'TextBox',
                 'Amin1',
                array(
                    'value'      => '',
                    'label'      => 'Min:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'
                ))

                ->addElement(
                 'TextBox',
                 'Amax1',
                array(
                    'value'      => '',
                    'label'      => 'Max:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'

                    ))

                //2

                ->addElement(
                'ComboBox',
                'A2',

                array(
                    'label' => 'Grade :',
                    'value' => 'blue',
                    'autocomplete' => false,
                    'multiOptions' => $this->_selectOptions,
                    'style' =>'width: 4em'
                ))

        ->addElement(
                 'TextBox',
                 'Amin2',
                array(
                    'value'      => '',
                    'label'      => 'Min:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'
                ))

                ->addElement(
                 'TextBox',
                 'Amax2',
                array(
                    'value'      => '',
                    'label'      => 'Max:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'

                    ))
                //3
                ->addElement(
                'ComboBox',
                'A3',

                array(
                    'label' => 'Grade :',
                    'value' => 'blue',
                    'autocomplete' => false,
                    'multiOptions' => $this->_selectOptions,
                    'style' =>'width: 4em'
                ))

        ->addElement(
                 'TextBox',
                 'Amin3',
                array(
                    'value'      => '',
                    'label'      => 'Min:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'
                ))

                ->addElement(
                 'TextBox',
                 'Amax3',
                array(
                    'value'      => '',
                    'label'      => 'Max:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'

                    ))

                //4
                ->addElement(
                'ComboBox',
                'A4',

                array(
                    'label' => 'Grade :',
                    'value' => 'blue',
                    'autocomplete' => false,
                    'multiOptions' => $this->_selectOptions,
                    'style' =>'width: 4em'
                ))

        ->addElement(
                 'TextBox',
                 'Amin4',
                array(
                    'value'      => '',
                    'label'      => 'Min:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'
                ))

                ->addElement(
                 'TextBox',
                 'Amax4',
                array(
                    'value'      => '',
                    'label'      => 'Max:',
                    'trim'       => true,
                    'propercase' => true,
                    'style' =>'width: 3em'

                    ))

                ;

                   


       // $addMoreScale = new Zend_Dojo_Form_SubForm();
       // $addMoreScale->setAttribs(array(
       //     'name' => 'addMoreScale',
       //     'legend' => 'Add more grade scale',
       //     ));
        
        


        $assignmentForm = new Zend_Dojo_Form_SubForm();
        $assignmentForm->setAttribs(array(
            'name'   => 'assignmentTab',
            'legend' => 'Course Assignments',
        ));
        
        $assessmentForm = new Zend_Dojo_Form_SubForm();
        $assessmentForm->setAttribs(array(
            'name'   => 'assessmentTab',
            'legend' => 'assessments',
            'dijitParams' => array(
                'title' => 'Assessment Groups'
            ),
        ));
        

        $assessmentForm->addElement(
                'ComboBox',
                'assessments1',
                array(
                    'value' => "",
                    'label' => 'Choose Assessment:',
                    'trim' => true,
                    'propercase' => true,
                    'multiOptions' => $this->_selectAssignments
                    
                )
            )

                ->addElement(
                 'ValidationTextBox',
                'assess_weight1',
                array(
                    'value'      => '',
                    'label'      => 'Assessment Weight :',
                    'trim'       => true,
                    'propercase' => true,
                    
                ))


                ->addElement(
                'ComboBox',
                'assessments2',
                array(
                    'value' => "",
                    'label' => 'Choose Assessment:',
                    'trim' => true,
                    'propercase' => true,
                    'multiOptions' => $this->_selectAssignments

                )
            )

         ->addElement(
                 'ValidationTextBox',
                'assess_weight2',
                array(
                    'value'      => '',
                    'label'      => 'Assessment Weight :',
                    'trim'       => true,
                    'propercase' => true,

                ))

              
->addElement(
                'ComboBox',
                'assessments3',
                array(
                    'value' => "",
                    'label' => 'Choose Assessment:',
                    'trim' => true,
                    'propercase' => true,
                    'multiOptions' => $this->_selectAssignments

                )
            )
          ->addElement(
                 'ValidationTextBox',
                'assess_weight3',
                array(
                    'value'      => '',
                    'label'      => 'Assessment Weight :',
                    'trim'       => true,
                    'propercase' => true,

                ))


                ->addElement(
                'ComboBox',
                'assessments4',
                array(
                    'value' => "",
                    'label' => 'Choose Assessment:',
                    'trim' => true,
                    'propercase' => true,
                    'multiOptions' => $this->_selectAssignments

                )
            )

           ->addElement(
                 'ValidationTextBox',
                'assess_weight4',
                array(
                    'value'      => '',
                    'label'      => 'Assessment Weight :',
                    'trim'       => true,
                    'propercase' => true,

                ))


            ->addElement(
                'ComboBox',
                'assessments5',
                array(
                    'value' => "",
                    'label' => 'Choose Assessment:',
                    'trim' => true,
                    'propercase' => true,
                    'multiOptions' => $this->_selectAssignments

                )
            )

                
            ->addElement(
                 'ValidationTextBox',
                'assess_weight5',
                array(
                    'value'      => '',
                    'label'      => 'Assessment Weight :',
                    'trim'       => true,
                    'propercase' => true,

                ))

                 ;

      
        

        $this->addSubForm($courseForm, 'courseTab')
             ->addSubForm($gradeScaleForm, 'gradeScaleTab')
             //->addsubForm($addMoreScale,'gradeScaleTab')
             ->addSubForm($assessmentForm, 'assessmentTab')

            // ->addSubForm($assignmentForm, 'assignmentTab')
           ;
        


    }
}

